<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="java.util.List,nc.vo.bd.countryzone.CountryZoneVO"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	List list = (List) request.getAttribute("list");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<title>下拉列表</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<script src="<%=path%>/js/jquery-1.4.4.js" type="text/javascript"></script>
		<script type="text/javascript">
		
		function choose() {
			var objs = jQuery(":radio");
			var name = "";
			var pk = "";
			for(var i=0;i<objs.length;i++){	
				if(objs[i].checked){
					var values = objs[i].value.split(",");
					pk = values[0];
					name = values[1];
				}
			}
			var id = '${id}';
			parent.document.getElementById(id+"name").value = name;
			parent.document.all.${id}.value = pk;
			parent.hideMe();
		}
		
		function clearvalue(){
			var id = '${id}';
			parent.document.getElementById(id+"name").value = "";
			parent.document.all.${id}.value = "";
			parent.hideMe();
		}
	</script>
	</head>

	<body>
		<div>
			<input type="button" value="确定" onClick="choose()" />
			&nbsp;&nbsp;&nbsp;&nbsp;
			<input type="button" value="清空" onClick="clearvalue()" />
		</div>
		<div style="overflow-y: scroll; width: 100%; height: 90%">
			<table border="0" cellspacing="0">
				<%
					if (list != null) {
						CountryZoneVO vo = null;
						for (int j = 1; j <= (list.size() + 1) / 2; j++) {
							vo = (CountryZoneVO) list.get(j * 2 - 2);
				%>
				<tr>
					<td>
						<input type="radio" name="hangye"
							value="<%=vo.getPk_country() + "," + vo.getName()%>" /><%=vo.getName()%>
					</td>
					<%
						if (j * 2 - 1 < list.size()) {
									vo = (CountryZoneVO) list.get(j * 2 - 1);
					%>
					<td>
						<input type="radio" name="hangye"
							value="<%=vo.getPk_country() + "," + vo.getName()%>" /><%=vo.getName()%>
					</td>
					<%
						}
					%>
				</tr>
				<%
					}
					}
				%>
			</table>
			<p></p>

		</div>
	</body>
</html>
